﻿using AutoMapper;
using CS.CleverNotes.Entities;
using CS.CleverNotes.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CS.CleverNotes.Infrastructure.Mappings
{
    public class ViewModelToDomainMappingProfile : Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<ToDoViewModel, Todo>()
                  .ForMember(p => p.Title, map => map.MapFrom(vm => vm.Title))
                  .ForMember(p => p.Id, map => map.MapFrom(vm => vm.Id))
                  .ForMember(p => p.Completed, map => map.MapFrom(vm => vm.Completed));
        }
    }
}
